extends ./admin

block main
  div 头像上传
    button(type="button", style="margin-left:10px;")#upload.layui-btn.layui-btn-danger
      i.layui-icon
      |上传图片
    .layui-inline.layui-word-aux
      |图片大小不超过 60KB 


  script.
    layui.use(["upload", "layer"], () => {
      const $ = layui.$
      const upload = layui.upload
      const layer = layui.layer

      //设定文件大小限制
      upload.render({
        elem: '#upload'
        ,url: '/upload'
        ,size: 1024 //限制文件大小，单位 KB
        //- ,done(res){
        //-   if(res.code === 1){
        //-     layer.alert('上传成功')
        //-   }else{
        //-     layer.alert('上传失败')
        //-   }
        //- }
      });
    })

